#include "MemberAccessNode.h"

#include "ScriptCompiler/Token/Token.h"

void CMemberAccessNode::DebugPrint(int32_t InDepth)
{
    //print Depth
    AccessChain[0]->DebugPrint(InDepth);

    for (int32_t i = 1; i < AccessChain.Num(); ++i)
    {
        if(AccessOperators[i - 1]->Type != EScriptTokenType::LeftBracket)
        {
            WH::Print(AccessOperators[i - 1]->ToString());
        }
        AccessChain[i]->DebugPrint(0);
    }
}

std::shared_ptr<CScriptToken> CMemberAccessNode::GetFirstToken()
{
    return AccessChain[0]->GetFirstToken();
}
